package com.example.bili.controller;

import com.example.bili.entity.Like;
import com.example.bili.service.LikeService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/like")
public class LikeController {
    //点赞添加
    @Resource
    private LikeService likeService;
    @GetMapping("/add")
    public Object add(@RequestParam int userId,
                      @RequestParam int trendId,
                      @RequestParam int zhuangt){
        return likeService.add(userId, trendId, zhuangt);
    }
    @GetMapping("/getLikeAll/{trendId}")
    public Object getLikeAll(@PathVariable int trendId){
        return likeService.getLikeAll(trendId);
    }

    @PostMapping("/addLike")
    public Object addLike(@RequestBody Like like){
        return likeService.addLike(like);
    }

    @GetMapping("/delLike/{id}")
    public Object delLike(@PathVariable int id){
        return likeService.delLike(id);
    }



}
